#pragma once

#ifndef _ACTOR_PACKET_H_
#define _ACTOR_PACKET_H_ 

#include <memory>
#include <string>
#include "base_type.h"
#include "byte_buffer.h"

typedef std::shared_ptr<ByteBuffer> ByteBufferPtr;
namespace as
{
namespace md
{
enum EMessageType
{
	SYS_MSG = 1,
};

enum ESubMessageId
{
	ReqFrameId = 1,
	RespFrameId = 2,
	HeartBeat = 3,
	ActorMsg = 4,
};

class ActorPacket : public ByteBuffer
{
public:
	ActorPacket(ByteBuffer *buf = nullptr);
	ActorPacket(uint32 sysId, uint32 subId, ByteBuffer *buf = nullptr);
	virtual ~ActorPacket();
	
	void Pack(ByteBuffer *buf);
	bool UnPack(uint32 &sysId, uint32 &subId, ByteBuffer *out);
	uint8* flust();
	uint8* GetData();
	uint16 GetSize();

	uint32 sysId_ = 0;
	uint32 subId_ = 0;

	ByteBuffer *final_;
};





}
}

#endif